<template>
  <div>
    <h1>我是Contant组件</h1>
    <ul>
      <li><router-link to="/content/a">All contacts</router-link></li>
      <li>
        <router-link to="/content/alice">Alice</router-link>
      </li>
      <li>
        <router-link to="/content/bob">Bob</router-link>
      </li>
    </ul>
    <button @click="btn">随机显示</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  methods: {
    btn() {
      let i = Math.floor(Math.random() * 3);
      let arr = ["/content/alice", "/content/bob", "/content/a"];
      this.$router.push(arr[i]);
    },
  },
};
</script>

<style>
</style>